import React, { Component } from "react";
import qs from "qs";

export default class Detail extends Component {
  render() {
    console.log(this.props);
    // const { id, name } = this.props.match.params;

    const { search } = this.props.location;
    const { id, name } = qs.parse(search.slice(1));

    // const {id,name} = this.props.location.state || {}

    return (
      <div>
        <h5>Detail</h5>
        <ul>
          <li>id:{id}</li>
          <li>name:{name}</li>
        </ul>
      </div>
    );
  }
}
